function addRoleUserDialog(
    {
        roleId,
        callback = Function()
    }
) {
    const $dialogWidget = selectUserDialog({
        title: `新增角色用户`,
        multipleFlag: false,
        callback: (userList = []) => {
            if (userList.length === 0) {
                return $.toast("请选择用户");
            }

            addRoleUser({
                roleId,
                userId: userList[0].userId
            }, ({Code, Message}) => {
                if (Code !== 10000) {
                    return $.toast(Message);
                }

                $dialogWidget.remove();
                $.toast("新增成功");
                callback();
            })
            return false;
        }
    });

    return $dialogWidget;

    function addRoleUser(param, callback = Function()) {
        return $.sApi({
            data: param,
            url: "/api/RoleUser/addRoleUser"
        }, callback)
    }

}